<html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" >  

    <ui:composition template="layout.xhtml">
        <ui:define name="corpo">
            <h:form id="buscar_form" acceptcharset="utf-8"> 
                <div id="breadcrumb">
                    <p:commandLink  actionListener="#{managerIndex.redirect('index.xhtml')}" value="Inicio" update="@form" immediate="true"/> >
                    <p:commandLink  actionListener="#{managerIndex.redirect('indexProtocolo.xhtml')}" value="Protocolo" update="@form" immediate="true"/> >
                    <p:commandLink  actionListener="#{managerIndex.redirect('indexPagamento.xhtml')}" value="Pagamento" update="@form" immediate="true"/> >
                    <p:commandLink   value="pesquisar" update="@form" immediate="true"/>
                </div>
                <p:panel header="Pesquisar Pagamento">
                    <p:growl showDetail="true"  id="msg" life="2000" /> 
                    <h:panelGrid columns="3"  styleClass="textAlignRight" columnClasses="textAlignRight" > 
                        <f:validateBean disabled="true">
                            <h:outputLabel value="Titulo : " />
                            <p:inputText  value="#{managerConsultarPagamento.pagamento.titulo}" size="40"/>
                            <br/>
                            <h:outputLabel value="Descrição : " />

                            <p:inputText  value="#{managerConsultarPagamento.pagamento.descricao}" size="40" />
                        </f:validateBean>

                    </h:panelGrid>
                    
                    <br/>
                    <center>
                        <p:commandButton value="Buscar" icon="ui-icon-search" actionListener="#{managerConsultarPagamento.pesquisar()}" update="@form, pagamentoTable, msg"/>
                        <p:commandButton id="limpar" icon="ui-icon-arrowreturnthick-1-w" value="Voltar" actionListener="#{managerVisualizarPagamento.redirect('indexPagamento.xhtml')}" immediate="true" />
                    </center>    
                    <br/>
                    <br/>
                    <p:dataTable id="pagamentoTable" var="pag" value="#{managerConsultarPagamento.lstPesquisar}" 
                                 paginator="true" rows="5"
                                 paginatorPosition="bottom"
                                 paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"  
                                 rowsPerPageTemplate="5,10,15">    

                        <f:facet name="header">  
                            Pagamentos
                        </f:facet>

                        <p:column style="width:300px;">  
                            <f:facet name="header" >   
                                Titulo
                            </f:facet>  
                            <h:outputText value="#{pag.titulo}" style="font-weight: bold;" />  
                        </p:column>

                        <p:column style="width:300px;">  
                            <f:facet name="header" >   
                                Interessado
                            </f:facet>  
                            <h:outputText value="#{pag.interessado}" style="font-weight: bold;" />  
                        </p:column>

                        <p:column style="width:300px;">  
                            <f:facet name="header" >   
                                Descricao
                            </f:facet>  
                            <h:outputText value="#{pag.descricao}" style="font-weight: bold;" />  
                        </p:column>

                        <p:column style="width:300px;">  
                            <f:facet name="header" >   
                                Executante
                            </f:facet>  
                            <h:outputText value="#{pag.executante.nome}" style="font-weight: bold;" />  
                        </p:column>



                        <p:column headerText="Valor R$"  style="width:128px;">  
                            <h:outputText value="#{pag.valor}" styleClass="teste" style="float: right; font-weight: bold" >
                                <f:convertNumber pattern="#,###,##0.00"/>
                            </h:outputText>
                        </p:column>

                        <p:column style="width:100px;">  
                            <f:facet name="header">  
                                <h:outputText value="Opções" />   
                            </f:facet>
                            <p:commandButton  icon="editar" actionListener="#{managerEditarPagamento.redirect('editarPagamento.xhtml', pag)}" update="@form"/> 
                            <p:commandButton  icon="view" actionListener="#{managerVisualizarPagamento.redirect('visualizarPagamento.xhtml', pag)}" update="@form"/>  

                        </p:column>

                    </p:dataTable> 

                </p:panel>
                <br/>
            </h:form>
        </ui:define>
    </ui:composition>
</html>